import Vue from 'vue'
import Router from 'vue-router'
import Meta from 'vue-meta'

Vue.use(Router)
Vue.use(Meta)

// route-level code splitting
const Home = () => import('@/views/home')
const Login = () => import('@/views/login')

export function createRouter () {
  return new Router({
    mode: 'history',
    fallback: false,
    scrollBehavior: () => ({ y: 0 }),
    routes: [
      {
        path: '/',
        name: 'home',
        component: Home,
        meta: {
          noLogin: true
        }
      },
      {
        path: '/login',
        name: 'login',
        component: Login,
        meta: {
          noLogin: true
        }
      }
    ]
  })
}
